home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-11-10 | 46.8 KB | 1,605 lines | [TEXT/MPS ] |
- {***********************************************************
-
- Created: Monday, November 8, 1993 11:28 AM
- OCE.p
- Pascal Interface to the Macintosh Libraries
-
- Copyright Apple Computer, Inc. 1990-1993
- All rights reserved
-
- ***********************************************************}
-
-
- {$IFC UNDEFINED UsingIncludes}
- {$SETC UsingIncludes:= 0}
- {$ENDC}
-
- {$IFC NOT UsingIncludes}
- UNIT OCE;
- INTERFACE
- {$ENDC}
-
- {$IFC UNDEFINED UsingOCE}
- {$SETC UsingOCE:= 1}
-
- {$I+}
- {$SETC OCEIncludes:= UsingIncludes}
- {$SETC UsingIncludes:= 1}
-
-
-
- {$IFC UNDEFINED UsingAliases}
- {$I $$Shell(PInterfaces)Aliases.p} { for AliasPtr }
- {$ENDC}
-
- {$IFC UNDEFINED UsingAppleEvents}
- {$I $$Shell(PInterfaces)AppleEvents.p} { for DescType }
- {$ENDC}
-
- {$IFC UNDEFINED UsingScript}
- {$I $$Shell(PInterfaces)Script.p} { for smRoman }
- {$ENDC}
-
- {$IFC UNDEFINED UsingTypes}
- {$I $$Shell(PInterfaces)Types.p}
- {$ENDC}
-
- {$SETC UsingIncludes:= OCEIncludes}
-
-
- {
- All utility routines defined here are callable at interrupt level. Currently,
- this is done at the expense of not using the international utilities package
- for STRING comparisons (we just use the ROM-based RelString trap).
- }
-
-
- {
- Defines for the trap selector values.
-
- Note: Some selector values also chosen from this same range of numbers appear
- in the file OCEMessaging.h. Check there before you add a new value.
- }
-
- CONST
- kOCECopyCreationID = 768;
- kOCECopyDirDiscriminator = 769;
- kOCECopyLocalRecordID = 770;
- kOCECopyPackedDSSpec = 771;
- kOCECopyPackedPathName = 772;
- kOCECopyPackedRLI = 773;
- kOCECopyPackedRecordID = 774;
- kOCECopyRLI = 775;
- kOCECopyRString = 776;
- kOCECopyRecordID = 777;
- kOCECopyShortRecordID = 778;
- kOCEDuplicateRLI = 779;
- kOCEEqualCreationID = 780;
- kOCEEqualDirDiscriminator = 781;
- kOCEEqualDSSpec = 782;
- kOCEEqualLocalRecordID = 783;
- kOCEEqualPackedDSSpec = 784;
- kOCEEqualPackedPathName = 785;
- kOCEEqualPackedRecordID = 786;
- kOCEEqualPackedRLI = 787;
- kOCEEqualRecordID = 788;
- kOCEEqualRLI = 789;
- kOCEEqualRString = 790;
- kOCEEqualShortRecordID = 791;
- kOCEExtractAlias = 792;
- kOCEGetDSSpecInfo = 793;
- kOCEGetIndAttributeType = 794;
- kOCEGetIndRecordType = 795;
- kOCEGetXtnType = 796;
- kOCEIsNullPackedPathName = 797;
- kOCENewLocalRecordID = 798;
- kOCENewRLI = 799;
- kOCENewRecordID = 800;
- kOCENewShortRecordID = 801;
- kOCEPackDSSpec = 802;
- kOCEPackPathName = 803;
- kOCEPackRLI = 804;
- kOCEPackRLIParts = 805;
- kOCEPackRecordID = 806;
- kOCEPackedDSSpecSize = 807;
- kOCEPackedPathNameSize = 808;
- kOCEPackedRLIPartsSize = 809;
- kOCEPackedRLISize = 810;
- kOCEPackedRecordIDSize = 811;
- kOCEDNodeNameCount = 812;
- kOCERelRString = 813;
- kOCESetCreationIDtoNull = 814;
- kOCEUnpackDSSpec = 815;
- kOCEUnpackPathName = 816;
- kOCEUnpackRLI = 817;
- kOCEUnpackRecordID = 818;
- kOCEValidPackedDSSpec = 819;
- kOCEValidPackedPathName = 820;
- kOCEValidPackedRecordID = 821;
- kOCEValidPackedRLI = 822;
- kOCEValidRLI = 823;
- kOCEValidRString = 824;
- kOCECToRString = 825;
- kOCEPToRString = 826;
- kOCERToPString = 827;
- kOCEPathFinderCID = 828;
- kOCEStreamPackedDSSpec = 829;
-
- kOCENullCID = 836;
- kOCEGetAccessControlDSSpec = 837;
- kOCEGetRootPackedRLI = 838;
-
-
-
-
- TYPE
- OCERecordTypeIndex = INTEGER;
- OCEAttributeTypeIndex = INTEGER;
-
-
- {
- All these standard definitions begin with the Apple symbol (not shown here).
-
- NOTE: To access these, you must call OCEGetIndRecordType or OCEGetIndAttributeType
- with the proper index. These routines return pointers to the standard type.
- This was done so that code fragments (INITs, CDEVs, DSAMs, etc). which cannot
- use global data can also use these.
- }
-
- { Indices for the standard definitions for certain record types (OCERecordTypeIndex): }
-
- CONST
- kUserRecTypeNum = 1; { "User" }
- kGroupRecTypeNum = 2; { "Group" }
- kMnMRecTypeNum = 3; { "AppleMail™ M&M" }
- kMnMForwarderRecTypeNum = 4; { "AppleMail™ Fwdr" }
- kNetworkSpecRecTypeNum = 5; { "NetworkSpec" }
- kADAPServerRecTypeNum = 6; { "ADAP Server" }
- kADAPDNodeRecTypeNum = 7; { "ADAP DNode" }
- kADAPDNodeRepRecTypeNum = 8; { "ADAP DNode Rep" }
- kServerSetupRecTypeNum = 9; { "Server Setup" }
- kDirectoryRecTypeNum = 10; { "Directory" }
- kDNodeRecTypeNum = 11; { "DNode" }
- kSetupRecTypeNum = 12; { "Setup" }
- kMSAMRecTypeNum = 13; { "MSAM" }
- kDSAMRecTypeNum = 14; { "DSAM" }
- kAttributeValueRecTypeNum = 15; { "Attribute Value" }
- kBusinessCardRecTypeNum = 16; { "Business Card" }
- kMailServiceRecTypeNum = 17; { "Mail Service" }
- kCombinedRecTypeNum = 18; { "Combined" }
- kOtherServiceRecTypeNum = 19; { "Other Service" }
- kAFPServiceRecTypeNum = 20; { "Other Service afps" }
-
- kFirstOCERecTypeNum = kUserRecTypeNum; { first standard OCE record type }
- kLastOCERecTypeNum = kAFPServiceRecTypeNum; { last standard OCE record type }
- kNumOCERecTypes = (kLastOCERecTypeNum - kFirstOCERecTypeNum + 1);
-
-
- { Indices for the standard definitions for certain attribute types (OCEAttributeTypeIndex): }
-
- kMemberAttrTypeNum = 1001; { "Member" }
- kAdminsAttrTypeNum = 1002; { "Administrators" }
- kMailSlotsAttrTypeNum = 1003; { "mailslots" }
- kPrefMailAttrTypeNum = 1004; { "pref mailslot" }
- kAddressAttrTypeNum = 1005; { "Address" }
- kPictureAttrTypeNum = 1006; { "Picture" }
- kAuthKeyAttrTypeNum = 1007; { "auth key" }
- kTelephoneAttrTypeNum = 1008; { "Telephone" }
- kNBPNameAttrTypeNum = 1009; { "NBP Name" }
- kQMappingAttrTypeNum = 1010; { "ForwarderQMap" }
- kDialupSlotAttrTypeNum = 1011; { "DialupSlotInfo" }
- kHomeNetAttrTypeNum = 1012; { "Home Internet" }
- kCoResAttrTypeNum = 1013; { "Co-resident M&M" }
- kFwdrLocalAttrTypeNum = 1014; { "FwdrLocalRecord" }
- kConnectAttrTypeNum = 1015; { "Connected To" }
- kForeignAttrTypeNum = 1016; { "Foreign RLIs" }
- kOwnersAttrTypeNum = 1017; { "Owners" }
- kReadListAttrTypeNum = 1018; { "ReadList" }
- kWriteListAttrTypeNum = 1019; { "WriteList" }
- kDescriptorAttrTypeNum = 1020; { "Descriptor" }
- kCertificateAttrTypeNum = 1021; { "Certificate" }
- kMsgQsAttrTypeNum = 1022; { "MessageQs" }
- kPrefMsgQAttrTypeNum = 1023; { "PrefMessageQ" }
- kMasterPFAttrTypeNum = 1024; { "MasterPF" }
- kMasterNetSpecAttrTypeNum = 1025; { "MasterNetSpec" }
- kServersOfAttrTypeNum = 1026; { "Servers Of" }
- kParentCIDAttrTypeNum = 1027; { "Parent CID" }
- kNetworkSpecAttrTypeNum = 1028; { "NetworkSpec" }
- kLocationAttrTypeNum = 1029; { "Location" }
- kTimeSvrTypeAttrTypeNum = 1030; { "TimeServer Type" }
- kUpdateTimerAttrTypeNum = 1031; { "Update Timer" }
- kShadowsOfAttrTypeNum = 1032; { "Shadows Of" }
- kShadowServerAttrTypeNum = 1033; { "Shadow Server" }
- kTBSetupAttrTypeNum = 1034; { "TB Setup" }
- kMailSetupAttrTypeNum = 1035; { "Mail Setup" }
- kSlotIDAttrTypeNum = 1036; { "SlotID" }
- kGatewayFileIDAttrTypeNum = 1037; { "Gateway FileID" }
- kMailServiceAttrTypeNum = 1038; { "Mail Service" }
- kStdSlotInfoAttrTypeNum = 1039; { "Std Slot Info" }
- kAssoDirectoryAttrTypeNum = 1040; { "Asso. Directory" }
- kDirectoryAttrTypeNum = 1041; { "Directory" }
- kDirectoriesAttrTypeNum = 1042; { "Directories" }
- kSFlagsAttrTypeNum = 1043; { "SFlags" }
- kLocalNameAttrTypeNum = 1044; { "Local Name" }
- kLocalKeyAttrTypeNum = 1045; { "Local Key" }
- kDirUserRIDAttrTypeNum = 1046; { "Dir User RID" }
- kDirUserKeyAttrTypeNum = 1047; { "Dir User Key" }
- kDirNativeNameAttrTypeNum = 1048; { "Dir Native Name" }
- kCommentAttrTypeNum = 1049; { "Comment" }
- kRealNameAttrTypeNum = 1050; { "Real Name" }
- kPrivateDataAttrTypeNum = 1051; { "Private Data" }
- kDirTypeAttrTypeNum = 1052; { "Directory Type" }
- kDSAMFileAliasAttrTypeNum = 1053; { "DSAM File Alias" }
- kCanAddressToAttrTypeNum = 1054; { "Can Address To" }
- kDiscriminatorAttrTypeNum = 1055; { "Discriminator" }
- kAliasAttrTypeNum = 1056; { "Alias" }
- kParentMSAMAttrTypeNum = 1057; { "Parent MSAM" }
- kParentDSAMAttrTypeNum = 1058; { "Parent DSAM" }
- kSlotAttrTypeNum = 1059; { "Slot" }
- kAssoMailServiceAttrTypeNum = 1060; { "Asso. Mail Service" }
- kFakeAttrTypeNum = 1061; { "Fake" }
- kInheritSysAdminAttrTypeNum = 1062; { "Inherit SysAdministrators" }
- kPreferredPDAttrTypeNum = 1063; { "Preferred PD" }
- kLastLoginAttrTypeNum = 1064; { "Last Login" }
- kMailerAOMStateAttrTypeNum = 1065; { "Mailer AOM State" }
- kMailerSendOptionsAttrTypeNum = 1066; { "Mailer Send Options" }
- kJoinedAttrTypeNum = 1067; { "Joined" }
- kUnconfiguredAttrTypeNum = 1068; { "Unconfigured" }
- kVersionAttrTypeNum = 1069; { "Version" }
- kLocationNamesAttrTypeNum = 1070; { "Location Names" }
- kActiveAttrTypeNum = 1071; { "Active" }
- kDeleteRequestedAttrTypeNum = 1072; { "Delete Requested" }
- kGatewayTypeAttrTypeNum = 1073; { "Gateway Type" }
-
- kFirstOCEAttrTypeNum = kMemberAttrTypeNum; { first standard OCE attr type }
- kLastOCEAttrTypeNum = kGatewayTypeAttrTypeNum; { last standard OCE attr type }
- kNumOCEAttrTypes = (kLastOCEAttrTypeNum - kFirstOCEAttrTypeNum + 1);
-
-
- { For anyone who absolutely needs a define of the body of the standard record or
- attribute type, use these below. CAUTION! All the types below are assumed to be
- in character set 'smRoman'. If you try to compare these to some RString or
- AttributeType variable, you must take the character set code into account. Future
- standard types may be defined using character sets other than 'smRoman'. The
- first character of each of these is $F0, the Apple symbol.
- }
-
- { Standard definitions for certain record types: }
-
- kUserRecTypeBody = 'aoce User';
- kGroupRecTypeBody = 'aoce Group';
- kMnMRecTypeBody = 'aoce AppleMail™ M&M';
- kMnMForwarderRecTypeBody = 'aoce AppleMail™ Fwdr';
- kNetworkSpecRecTypeBody = 'aoce NetworkSpec';
- kADAPServerRecTypeBody = 'aoce ADAP Server';
- kADAPDNodeRecTypeBody = 'aoce ADAP DNode';
- kADAPDNodeRepRecTypeBody = 'aoce ADAP DNode Rep';
- kServerSetupRecTypeBody = 'aoce Server Setup';
- kDirectoryRecTypeBody = 'aoce Directory';
- kDNodeRecTypeBody = 'aoce DNode';
- kSetupRecTypeBody = 'aoce Setup';
- kMSAMRecTypeBody = 'aoce MSAM';
- kDSAMRecTypeBody = 'aoce DSAM';
- kAttributeValueRecTypeBody = 'aoce Attribute Value';
- kBusinessCardRecTypeBody = 'aoce Business Card';
- kMailServiceRecTypeBody = 'aoce Mail Service';
- kCombinedRecTypeBody = 'aoce Combined';
- kOtherServiceRecTypeBody = 'aoce Other Service';
- kAFPServiceRecTypeBody = 'aoce Other Service afps';
-
- { Standard definitions for certain attribute types: }
-
- kMemberAttrTypeBody = 'aoce Member';
- kAdminsAttrTypeBody = 'aoce Administrators';
- kMailSlotsAttrTypeBody = 'aoce mailslots';
- kPrefMailAttrTypeBody = 'aoce pref mailslot';
- kAddressAttrTypeBody = 'aoce Address';
- kPictureAttrTypeBody = 'aoce Picture';
- kAuthKeyAttrTypeBody = 'aoce auth key';
- kTelephoneAttrTypeBody = 'aoce Telephone';
- kNBPNameAttrTypeBody = 'aoce NBP Name';
- kQMappingAttrTypeBody = 'aoce ForwarderQMap';
- kDialupSlotAttrTypeBody = 'aoce DialupSlotInfo';
- kHomeNetAttrTypeBody = 'aoce Home Internet';
- kCoResAttrTypeBody = 'aoce Co-resident M&M';
- kFwdrLocalAttrTypeBody = 'aoce FwdrLocalRecord';
- kConnectAttrTypeBody = 'aoce Connected To';
- kForeignAttrTypeBody = 'aoce Foreign RLIs';
- kOwnersAttrTypeBody = 'aoce Owners';
- kReadListAttrTypeBody = 'aoce ReadList';
- kWriteListAttrTypeBody = 'aoce WriteList';
- kDescriptorAttrTypeBody = 'aoce Descriptor';
- kCertificateAttrTypeBody = 'aoce Certificate';
- kMsgQsAttrTypeBody = 'aoce MessageQs';
- kPrefMsgQAttrTypeBody = 'aoce PrefMessageQ';
- kMasterPFAttrTypeBody = 'aoce MasterPF';
- kMasterNetSpecAttrTypeBody = 'aoce MasterNetSpec';
- kServersOfAttrTypeBody = 'aoce Servers Of';
- kParentCIDAttrTypeBody = 'aoce Parent CID';
- kNetworkSpecAttrTypeBody = 'aoce NetworkSpec';
- kLocationAttrTypeBody = 'aoce Location';
- kTimeSvrTypeAttrTypeBody = 'aoce TimeServer Type';
- kUpdateTimerAttrTypeBody = 'aoce Update Timer';
- kShadowsOfAttrTypeBody = 'aoce Shadows Of';
- kShadowServerAttrTypeBody = 'aoce Shadow Server';
- kTBSetupAttrTypeBody = 'aoce TB Setup';
- kMailSetupAttrTypeBody = 'aoce Mail Setup';
- kSlotIDAttrTypeBody = 'aoce SlotID';
- kGatewayFileIDAttrTypeBody = 'aoce Gateway FileID';
- kMailServiceAttrTypeBody = 'aoce Mail Service';
- kStdSlotInfoAttrTypeBody = 'aoce Std Slot Info';
- kAssoDirectoryAttrTypeBody = 'aoce Asso. Directory';
- kDirectoryAttrTypeBody = 'aoce Directory';
- kDirectoriesAttrTypeBody = 'aoce Directories';
- kSFlagsAttrTypeBody = 'aoce SFlags';
- kLocalNameAttrTypeBody = 'aoce Local Name';
- kLocalKeyAttrTypeBody = 'aoce Local Key';
- kDirUserRIDAttrTypeBody = 'aoce Dir User RID';
- kDirUserKeyAttrTypeBody = 'aoce Dir User Key';
- kDirNativeNameAttrTypeBody = 'aoce Dir Native Name';
- kCommentAttrTypeBody = 'aoce Comment';
- kRealNameAttrTypeBody = 'aoce Real Name';
- kPrivateDataAttrTypeBody = 'aoce Private Data';
- kDirTypeAttrTypeBody = 'aoce Directory Type';
- kDSAMFileAliasAttrTypeBody = 'aoce DSAM File Alias';
- kCanAddressToAttrTypeBody = 'aoce Can Address To';
- kDiscriminatorAttrTypeBody = 'aoce Discriminator';
- kAliasAttrTypeBody = 'aoce Alias';
- kParentMSAMAttrTypeBody = 'aoce Parent MSAM';
- kParentDSAMAttrTypeBody = 'aoce Parent DSAM';
- kSlotAttrTypeBody = 'aoce Slot';
- kAssoMailServiceAttrTypeBody = 'aoce Asso. Mail Service';
- kFakeAttrTypeBody = 'aoce Fake';
- kInheritSysAdminAttrTypeBody = 'aoce Inherit SysAdministrators';
- kPreferredPDAttrTypeBody = 'aoce Preferred PD';
- kLastLoginAttrTypeBody = 'aoce Last Login';
- kMailerAOMStateAttrTypeBody = 'aoce Mailer AOM State';
- kMailerSendOptionsAttrTypeBody = 'aoce Mailer Send Options';
- kJoinedAttrTypeBody = 'aoce Joined';
- kUnconfiguredAttrTypeBody = 'aoce Unconfigured';
- kVersionAttrTypeBody = 'aoce Version';
- kLocationNamesAttrTypeBody = 'aoce Location Names';
- kActiveAttrTypeBody = 'aoce Active';
- kDeleteRequestedAttrTypeBody = 'aoce Delete Requested';
- kGatewayTypeAttrTypeBody = 'aoce Gateway Type';
-
-
-
- { Miscellaneous enums: }
-
- kRString32Size = 32; { max size of the body field in RString32 }
- kRString64Size = 64; { max size of the body field in RString64 }
- kNetworkSpecMaxBytes = 32; { max size of the body field in NetworkSpec }
- kPathNameMaxBytes = 1024; { max size of the data field in PackedPathName }
- kDirectoryNameMaxBytes = 32; { max size of the body field in DirectoryName }
- kAttributeTypeMaxBytes = 32; { max size of the body field in AttributeType }
- kAttrValueMaxBytes = 65536; { max size of any attribute value }
- kRStringMaxBytes = 256; { max size (bytes: in) of the body field of a recordName or recordType }
- kRStringMaxChars = 128; { max size (chars: in) of the body field of a recordName or recordType }
-
-
-
- kNULLDNodeNumber = 0; { Special value meaning none specified }
- kRootDNodeNumber = 2; { DNodeNum corresponding to the root of the tree }
-
-
-
-
- {
- This enum is used to select the kind of RString in calls such as OCERelRString,
- OCEEqualRString, and OCEValidRString.
-
- eGenericSensitive and eGenericInsensitive are enumerators that can be used if you
- use RStrings for things other than what you see in this file. If you want them to
- be compared in a case- and diacritical-sensitive manner (c ≠ C ≠ ç), use
- eGenericSensitive. If you want them to be compared in a case- and diacritical-
- insensitive manner (c = C = ç), use eGenericInensitive.
- WARNING: do not use eGenericSensitive and eGenericInsensitive with directory
- names, entity names, pathname parts, entity types, network specs, or attribute
- types! Don't assume that you know how they should be compared!!!
- }
-
- { values of RStringKind }
- CONST
- kOCEDirName = 0;
- kOCERecordOrDNodeName = 1;
- kOCERecordType = 2;
- kOCENetworkSpec = 3;
- kOCEAttrType = 4;
- kOCEGenericSensitive = 5;
- kOCEGenericInsensitive = 6;
-
- TYPE
- RStringKind = INTEGER;
-
-
- { Values for the signature field in Discriminator }
-
- { values of OCEDirectoryKind }
- CONST
- kDirAllKinds = 0;
- kDirADAPKind = 'adap';
- kDirPersonalDirectoryKind = 'pdir';
- kDirDSAMKind = 'dsam';
-
- TYPE
- OCEDirectoryKind = LONGINT;
-
-
- { Values returned by GetDSSpecInfo() }
- CONST
- kOCEInvalidDSSpec = '????'; { could not be determined }
- kOCEDirsRootDSSpec = 'root'; { root of all catalogs ("Catalogs" icon) }
- kOCEDirectoryDSSpec = 'dire'; { catalog }
- kOCEDNodeDSSpec = 'dnod'; { d-node }
- kOCERecordDSSpec = 'reco'; { record }
- kOCEentnDSSpec = 'entn'; { extensionType is 'entn' }
- kOCENOTentnDSSpec = 'not '; { extensionType is not 'entn' }
-
-
-
-
- { Values for AttributeTag }
- typeRString = 'rstr';
- typePackedDSSpec = 'dspc';
- typeBinary = 'bnry';
-
-
-
-
- {
- Bit flag corresponding to the isCluster bit. Use it like this:
- if (foo & kCanContainRecordsBit)
- then this is a cluster!
- kForeignNode is used to indicate nodes in the name hierarchy that correspond to
- foreign directories (meaning ADAP sees no clusters or DNodes beneath it, but
- mail routers might be able to route to clusters beneath it.
- }
-
- kCanContainRecordsBit = 0;
- kForeignNodeBit = 1;
-
- { values of DirNodeKind }
- kCanContainRecords = $00000001; {1<<kCanContainRecordsBit}
- kForeignNode = $00000002; {1<<kForeignNodeBit}
-
- TYPE
- DirNodeKind = LONGINT;
-
-
-
-
- {*** Toolbox Control ***}
-
- {
- We will have a version number and attributes for toolboxes off the aa5e trap
- and the S&F server trap.
-
- This includes the OCE toolbox and S&F Server. [Note: the S&F server will
- change to ONLY service ServerGateway calls —it will then be necessary to run
- it co–resident with an OCE toolbox].
-
- The high order word will represent the S&F Server version number. The low
- order word will represent the OCE toolbox version number. These will be zero
- until the component is up and running. It is not possible to know these
- a–priori. Note: there will not be a seperate version numbers for each component
- in the OCE toolbox or S&F server.
-
- The above is consistent with the standard System 7.0 usage of Gestalt.
-
- The oce tb attribute gestaltOCETBPresent implies the existence of OCE on a
- machine.
-
- The OCE TB attribute gestaltOCETBAvailable implies the availablity of OCE calls.
-
- The attribute gestaltOCESFServerAvailable implies the availablity of OCE calls
- available through the S&F server. This are essentially the server gateway calls.
-
- Any (future) remaining OCE attributes may not be established correctly until
- the attribute gestaltOCETBAvailable is set.
-
- The gestalt selectors and values are listed below:
- }
-
- CONST
- gestaltOCEToolboxVersion = 'ocet'; { OCE Toolbox version }
- gestaltOCEToolboxAttr = 'oceu'; { OCE Toolbox attributes }
-
-
-
- { version includes:
- * dirtb
- * authtb
- * mailtb
- * ipmtb
- * personal directory
- * ADSPSecure
- * e.g. all interfaces dependent on the aa5e trap.
- }
- gestaltOCETB = $0100; { OCE Toolbox version 1.0 }
- gestaltSFServer = $0100; { S&F Server version 1.0 }
- gestaltOCETBPresent = $1; { OCE toolbox is present, not running }
- gestaltOCETBAvailable = $2; { OCE toolbox is running and available }
- gestaltOCESFServerAvailable = $4; { S&F Server is running and available }
-
-
- { Constants used for Transitions. }
-
- ATTransIPMStart = 'ipms';
- ATTransIPMShutdown = 'ipmd';
- ATTransDirStart = 'dirs';
- ATTransDirShutdown = 'dird';
- ATTransAuthStart = 'auts';
- ATTransAuthShutdown = 'autd';
- ATTransSFStart = 's&fs';
- ATTransSFShutdown = 's&fd';
-
-
-
-
-
- { Some definitions for time-related parameters: }
-
- TYPE
- UTCTime = LONGINT; { Interpreted as UTC seconds since 1/1/1904 }
- UTCOffset = LONGINT; { seconds EAST of Greenwich }
-
-
- CharacterSet = INTEGER; { This is the same as the ScriptManager script. }
-
-
- {*** RString ***}
-
-
- {
- struct RString is a maximum-sized structure. Allocate one of these and it will
- hold any valid RString.
- }
-
- RStringHeader = RECORD
- charSet: CharacterSet;
- dataLength: INTEGER;
- END;
-
- RString = RECORD
- charSet: CharacterSet;
- dataLength: INTEGER;
-
- body: PACKED ARRAY[1..kRStringMaxBytes] OF Byte; { place for characters }
- END;
-
-
- { struct ProtoRString is a minimum-sized structure. Use this for a variable-length
- RString. }
-
- ProtoRString = RECORD { proto-RString used for variable length rStrings }
- charSet: CharacterSet;
- dataLength: INTEGER;
-
- { Followed by body }
- END;
-
- RStringPtr = ^RString;
- RStringHandle = ^RStringPtr;
- ProtoRStringPtr = ^ProtoRString;
-
- CONST
- kMinPackedRStringLength = sizeof(ProtoRString);
-
-
- TYPE
- RString64 = RECORD
- charSet: CharacterSet;
- dataLength: INTEGER;
-
- body: PACKED ARRAY[1..kRString64Size] OF Byte;
- END;
-
- RString32 = RECORD
- charSet: CharacterSet;
- dataLength: INTEGER;
-
- body: PACKED ARRAY[1..kRString32Size] OF Byte;
- END;
-
- RString32Ptr = ^RString32;
-
-
-
- {
- Standard definitions for the entity type field and attribute type
- have been moved to the end of the file.
- }
-
-
- {
- Copies str1 to str2. str2Length is the size of str2, excluding header.
- A memFull error will be returned if that is not as large as str1->length.
- }
-
- FUNCTION OCECopyRString(str1: RStringPtr; str2: RStringPtr; str2Length: INTEGER): OSErr;
- INLINE $303C, kOCECopyRString, $AA5C;
-
-
- { Make an RString from a C STRING. If the c STRING is bigger than rStrLength,
- only rStrLength bytes will be copied. (rStrLength does not include the header size) }
-
- PROCEDURE OCECToRString(cStr: Ptr; charSet: CharacterSet; rStr: RStringPtr;
- rStrLength: INTEGER);
- INLINE $303C, kOCECToRString, $AA5C;
-
-
- { Make an RString from a Pascal STRING. If the Pascal STRING is bigger than rStrLength,
- only rStrLength bytes will be copied. (rStrLength does not include the header size) }
-
- PROCEDURE OCEPToRString(pStr: Str255; charSet: CharacterSet; rStr: RStringPtr;
- rStrLength: INTEGER);
- INLINE $303C, kOCEPToRString, $AA5C;
-
-
- { Make a Pascal STRING from an RString. It's up to you to check the CHAR set of
- the RString, or if the length of the RString is greater than 255 (the Pascal STRING's
- length will simply be the lower byte of the RString's length). The StringPtr that is
- returned will point directly into the RString (no memory will be allocated). }
-
- FUNCTION OCERToPString(rStr: RStringPtr): StringPtr; INLINE $303C, kOCERToPString, $AA5C;
-
-
- { Check the relative equality of two RStrings. Determines if str1 is greater than,
- equal to, or less than str2. Result types for OCERelRString are defined in <OSUtils.h>
- (same as for RelString). }
-
- FUNCTION OCERelRString(str1: UNIV Ptr; str2: UNIV Ptr; kind: RStringKind): INTEGER;
- INLINE $303C, kOCERelRString, $AA5C;
-
-
- { Check for equality of two RStrings. Returns true if equal. }
-
- FUNCTION OCEEqualRString(str1: UNIV Ptr; str2: UNIV Ptr; kind: RStringKind): BOOLEAN;
- INLINE $303C, kOCEEqualRString, $AA5C;
-
-
- { Check the validity of an RString. Returns true if the RString is valid }
-
- FUNCTION OCEValidRString(str: UNIV Ptr; kind: RStringKind): BOOLEAN;
- INLINE $303C, kOCEValidRString, $AA5C;
-
-
-
-
- {*** CreationID ***}
-
- TYPE
- CreationID = RECORD
- source: LONGINT; { Fields definitions and usage are not defined }
- seq: LONGINT;
- END;
-
- AttributeCreationID = CreationID;
- CreationIDPtr = ^CreationID;
-
-
-
-
- { Returns a pointer to a null CreationID . }
-
- FUNCTION OCENullCID: CreationIDPtr;
- INLINE $303C, kOCENullCID, $AA5C;
-
-
- { Returns a pointer to a special CreationID used within the PathFinder. }
-
- FUNCTION OCEPathFinderCID: CreationIDPtr;
- INLINE $303C, kOCEPathFinderCID, $AA5C;
-
-
- { Sets the CreationID to a null value. }
-
- PROCEDURE OCESetCreationIDtoNull(VAR cid: CreationID);
- INLINE $303C, kOCESetCreationIDtoNull, $AA5C;
-
-
- { Copies the value of cid1 to cid2. }
-
- PROCEDURE OCECopyCreationID(cid1: CreationID; VAR cid2: CreationID);
- INLINE $303C, kOCECopyCreationID, $AA5C;
-
-
- { Check the equality of two CreationIDs. }
-
- FUNCTION OCEEqualCreationID(cid1: CreationID; cid2: CreationID): BOOLEAN;
- INLINE $303C, kOCEEqualCreationID, $AA5C;
-
-
-
-
- {*** NetworkSpec ***}
-
- {
- For the record, a NetworkSpec is an RString with a smaller maximum size.
- I don't justtypedef it to an RString, because I want the definition of the NetworkSpec
- struct to contain the max length. But it should be possible to typecast any
- NetworkSpec to an RString and use all the RString utilities on it.
- }
-
- TYPE
- NetworkSpec = RECORD
- charSet: CharacterSet;
- dataLength: INTEGER;
-
- body: PACKED ARRAY[1..kNetworkSpecMaxBytes] OF Byte; { always fixed at the max size }
- END;
-
- NetworkSpecPtr = ^NetworkSpec;
-
-
-
- {*** PackedPathName ***}
-
- {
- struct PackedPathName is a maximum-sized structure. Allocate one of
- these and it will hold any valid packed pathname.
- }
-
- PackedPathNameHeader = RECORD
- dataLength: INTEGER; { length excludes the space for the length field }
- END;
-
- CONST
- kPathNameMaxBytesMinusSizeofInteger = kPathNameMaxBytes - sizeof(INTEGER);
-
- TYPE
- PackedPathName = RECORD
- dataLength: INTEGER;
-
- data: PACKED ARRAY[1..kPathNameMaxBytesMinusSizeofInteger] OF Byte;
- END;
-
-
- {
- struct ProtoPackedPathName is a minimum-sized structure. Use this
- for a variable-length packed PathName.
- }
-
- ProtoPackedPathName = RECORD
- dataLength: INTEGER;
-
- { Followed by data }
- END;
-
- PackedPathNamePtr = ^PackedPathName;
- ProtoPackedPathNamePtr = ^ProtoPackedPathName;
-
-
-
-
- {
- Copy the contents of path1 to path2. path2Length is the size of path2, and must
- be large enough to hold a copy of path1. A memFull error will be returned if that
- is not the case.
- }
-
- FUNCTION OCECopyPackedPathName(path1: PackedPathNamePtr; path2: PackedPathNamePtr;
- path2Length: INTEGER): OSErr;
- INLINE $303C, kOCECopyPackedPathName, $AA5C;
-
-
- {
- Returns true if packed path pointer is nil, or is of zero length, or is of
- length 2 and nParts of zero.
- }
-
- FUNCTION OCEIsNullPackedPathName(path: PackedPathNamePtr): BOOLEAN;
- INLINE $303C, kOCEIsNullPackedPathName, $AA5C;
-
-
- {
- OCEUnpackPathName breaks apart the path into its component RStrings, writing STRING
- pointers into the array 'parts', which the client asserts can hold as many as
- 'nParts' elements. The number of parts actually found is returned. STRINGs are
- placed in the array in order from lowest to highest. The first pathName element
- beneath the root appears last. NOTE THAT THE UNPACKED STRUCT CONTAINS POINTERS INTO
- THE PACKED STRUCT - DON'T DELETE OR REUSE THE PACKED STRUCT UNTIL YOU ARE FINISHED
- WITH THE UNPACKED STRUCT AS WELL
- }
-
- FUNCTION OCEUnpackPathName(path: PackedPathNamePtr; VAR parts: RStringPtr;
- nParts: INTEGER): INTEGER;
- INLINE $303C, kOCEUnpackPathName, $AA5C;
-
-
- {
- OCEPackedPathNameSize computes the number of bytes of memory needed to hold a
- PackedPathName manufactured from the array of parts. This length
- includes the length of the length field of PackedPathName, so it
- is safe to do a NewPtr (OCEPackedPathNameSize(...)).
- }
-
- FUNCTION OCEPackedPathNameSize(VAR parts: RStringPtr; nParts: INTEGER): INTEGER;
- INLINE $303C, kOCEPackedPathNameSize, $AA5C;
-
-
- { OCEDNodeNameCount returns the number of RStrings contained within the path. }
-
- FUNCTION OCEDNodeNameCount(path: PackedPathNamePtr): INTEGER;
- INLINE $303C, kOCEDNodeNameCount, $AA5C;
-
-
- {
- OCEPackPathName packs the parts into the storage provided as 'path'. path must be
- large enough to hold the packed pathname. A memFull error will be returned if
- pathLength is too small. parts[0] should contain the deepest pathName element,
- and parts[nParts - 1] should contain the name of the first pathName element beneath
- the root.
- }
-
- FUNCTION OCEPackPathName(VAR parts: RStringPtr; nParts: INTEGER;
- path: PackedPathNamePtr; pathLength: INTEGER): OSErr;
- INLINE $303C, kOCEPackPathName, $AA5C;
-
-
- {
- Check the equality of two packed paths.
- }
-
- FUNCTION OCEEqualPackedPathName(path1: PackedPathNamePtr;
- path2: PackedPathNamePtr): BOOLEAN;
- INLINE $303C, kOCEEqualPackedPathName, $AA5C;
-
-
- {
- OCEValidPackedPathName checks that the packed PathName is internally consistent.
- Returns true if it's ok.
- }
-
- FUNCTION OCEValidPackedPathName(path: PackedPathNamePtr): BOOLEAN;
- INLINE $303C, kOCEValidPackedPathName, $AA5C;
-
-
-
-
- {*** DirDiscriminator ***}
-
- TYPE
- DirDiscriminator = RECORD
- signature: OCEDirectoryKind;
- misc: LONGINT;
- END;
-
-
-
-
- { Copies the value of disc1 to disc2. }
-
- PROCEDURE OCECopyDirDiscriminator(disc1: DirDiscriminator;
- VAR disc2: DirDiscriminator);
- INLINE $303C, kOCECopyDirDiscriminator, $AA5C;
-
-
- { Check the equality of two DirDiscriminators. }
-
- FUNCTION OCEEqualDirDiscriminator(disc1: DirDiscriminator;
- disc2: DirDiscriminator): BOOLEAN;
- INLINE $303C, kOCEEqualDirDiscriminator, $AA5C;
-
-
-
- {********************************************************************************
-
- This structure is called RLI because it really contains all the info you
- need to locate a record within the entire name space. It contains four fields.
- The first two are the name of the directory and a directory discriminator. These
- two fields are used to indicate to which directory a given record belongs. The
- discriminator is used to distinguish between two different directories that have
- the same name.
-
- The other two fields in the RLI structure are used to indicate a particular
- directory node within the directory specified by the directoryName and
- discriminator fields. These fields are exactly analagous to the dirID and
- pathname used in HFS. It is possible to specify a dNode just by dNodeNumber
- (pathname is nil), or just by pathname (dNodeNumber is set to kNULLDNodeNumber),
- or by a combination of the two. The latter is called a 'partial pathname', and
- while it is valid in the Directory Manager API, it is not supported by ADAP
- directories in Release 1.
-
- Note that the path parameter does not include the directory name, but holds
- the names of all the nodes on the path to the desired directory node, starting
- with the directory node and working its way up the tree.
-
- ********************************************************************************}
-
-
- {*** RLI ***}
-
-
- TYPE
- DirectoryName = RECORD
- charSet: CharacterSet;
- dataLength: INTEGER;
-
- body: PACKED ARRAY[1..kDirectoryNameMaxBytes] OF Byte; { space for directory name }
- END;
-
- DirectoryNamePtr = ^DirectoryName;
-
-
- DNodeNum = LONGINT; { Directory node number }
-
- RLI = RECORD { Record Location Info structure: }
- directoryName: DirectoryNamePtr; { pointer to the name of the directory root }
- discriminator: DirDiscriminator; { used to discriminate between dup dir names }
- dNodeNumber: DNodeNum; { number of the node }
- path: PackedPathNamePtr; { old-style RLI }
- END;
-
- RLIPtr = ^RLI;
-
-
-
-
-
- {
- Create a new RLI from the directory name, discriminator, DNode number, and
- PackedPathName. You must allocate the storage for the RLI and pass in a pointer
- to it.
- }
-
- PROCEDURE OCENewRLI(VAR newRLI: RLI; dirName: DirectoryNamePtr;
- VAR discriminator: DirDiscriminator; dNodeNumber: DNodeNum;
- path: PackedPathNamePtr);
- INLINE $303C, kOCENewRLI, $AA5C;
-
-
- {
- Duplicate the contents of rli1 to rli2. No errors are returned. This
- simply copies the pointers to the directory name and path, wiping out any pointer
- that you might have had in there.
- }
-
- PROCEDURE OCEDuplicateRLI(rli1: RLI; VAR rli2: RLI);
- INLINE $303C, kOCEDuplicateRLI, $AA5C;
-
-
- {
- Copy the contents of rli1 to rli2. rli2 must already contain
- pointers to structures large enough to hold copies of the corresponding
- fields from rli1. A memFull error will be returned if that is not the case.
- So if you allocate a brand new empty destination, you must at least set up
- its length fields.
- }
-
- FUNCTION OCECopyRLI(rli1: RLI; VAR rli2: RLI): OSErr;
- INLINE $303C, kOCECopyRLI, $AA5C;
-
-
- {
- Check the equality of two RLIs. This will take into account differences
- in the case and diacriticals of the directoryName and the PathName.
- NOTE THAT THIS WILL FAIL IF rli1 CONTAINS A DNODENUMBER AND A NIL PATHNAME,
- AND rli2 CONTAINS kNULLDNodeNumber AND A NON-NIL PATHNAME. IN OTHER WORDS,
- THE TWO rlis MUST BE OF THE SAME FORM TO CHECK FOR EQUALITY.
- The one exception is that if the pathname is nil, a dNodeNumber of zero and
- kRootDNodeNumber will be treated as equal.
- }
-
- FUNCTION OCEEqualRLI(rli1: RLI; rli2: RLI): BOOLEAN;
- INLINE $303C, kOCEEqualRLI, $AA5C;
-
-
- {
- Check the validity of an RLI. This checks that the directory name length
- is within bounds, and the packed pathname (specified: if) is valid.
- }
-
- FUNCTION OCEValidRLI(theRLI: RLI): BOOLEAN;
- INLINE $303C, kOCEValidRLI, $AA5C;
-
-
-
-
- {*** PackedRLI ***}
-
- {
- struct PackedRLI is a maximum-sized structure. Allocate one of
- these and it will hold any valid packed pathname.
- }
-
- CONST
- kRLIMaxBytes = (sizeof (RString) + sizeof (DirDiscriminator) +
- sizeof (DNodeNum) + kPathNameMaxBytes);
-
- TYPE
- PackedRLIHeader = RECORD
- dataLength: INTEGER; { length excludes the space for the length field }
- END;
-
- PackedRLI = RECORD
- dataLength: INTEGER;
-
- data: PACKED ARRAY[1..kRLIMaxBytes] OF Byte;
- END;
-
-
- {
- struct ProtoPackedRLI is a minimum-sized structure. Use this
- for a variable-length packed RLI.
- }
-
- ProtoPackedRLI = RECORD
- dataLength: INTEGER;
-
- { Followed by data }
- END;
-
-
- PackedRLIPtr = ^PackedRLI;
- ProtoPackedRLIPtr = ^ProtoPackedRLI;
-
- CONST
- kMinPackedRLISize = (sizeof (ProtoPackedRLI) +
- sizeof (DirDiscriminator) + sizeof (DNodeNum) +
- kMinPackedRStringLength + sizeof (ProtoPackedPathName));
-
-
-
-
- {
- Copy the contents of prli1 to prli2. prli2Length is the size of prli2, and must
- be large enough to hold a copy of prli1. A memFull error will be returned if that
- is not the case.
- }
-
- FUNCTION OCECopyPackedRLI(prli1: PackedRLIPtr; prli2: PackedRLIPtr;
- prli2Length: INTEGER): OSErr;
- INLINE $303C, kOCECopyPackedRLI, $AA5C;
-
-
- {
- OCEUnpackRLI breaks apart the prli into its components, writing pointers into
- the rli structure. NOTE THAT THE UNPACKED STRUCT CONTAINS POINTERS INTO THE
- PACKED STRUCT - DON'T DELETE OR REUSE THE PACKED STRUCT UNTIL YOU ARE FINISHED
- WITH THE UNPACKED STRUCT AS WELL
- }
-
- PROCEDURE OCEUnpackRLI(prli: PackedRLIPtr; VAR theRLI: RLI);
- INLINE $303C, kOCEUnpackRLI, $AA5C;
-
-
- {
- OCEPackedRLISize computes the number of bytes of memory needed to hold a
- PackedRLI manufactured from an RLI. This length
- includes the length of the length field of PackedRLI, so it
- is safe to do a NewPtr (OCEPackedRLISize(...)).
- }
-
- FUNCTION OCEPackedRLISize(theRLI: RLI): INTEGER;
- INLINE $303C, kOCEPackedRLISize, $AA5C;
-
-
- {
- OCEPackRLI packs the RLI into the storage provided as 'prli'. prli must be
- large enough to hold the packed RLI. A memFull error will be returned if
- prliLength is too small.
- }
-
- FUNCTION OCEPackRLI(theRLI: RLI; prli: PackedRLIPtr; prliLength: INTEGER): OSErr;
- INLINE $303C, kOCEPackRLI, $AA5C;
-
-
- {
- OCEPackedRLIPartsSize computes the number of bytes of memory needed to hold a
- PackedRLI manufactured from the parts of an RLI. This length
- includes the length of the length field of PackedRLI, so it
- is safe to do a NewPtr (OCEPackedRLIPartsSize(...)).
- }
-
- FUNCTION OCEPackedRLIPartsSize(dirName: DirectoryNamePtr;
- VAR parts: RStringPtr; nParts: INTEGER): INTEGER;
- INLINE $303C, kOCEPackedRLIPartsSize, $AA5C;
-
-
- {
- OCEPackRLIParts packs the parts of an RLI into the storage provided as 'prli'.
- prli must be large enough to hold the packed RLI. A memFull error will be returned
- if prliLength is too small.
- }
-
- FUNCTION OCEPackRLIParts(dirName: DirectoryNamePtr;
- discriminator: DirDiscriminator; dNodeNumber: DNodeNum;
- VAR parts: RStringPtr; nParts: INTEGER; prli: PackedRLIPtr;
- prliLength: INTEGER): OSErr;
- INLINE $303C, kOCEPackRLIParts, $AA5C;
-
-
- {
- Check the equality of two packed prlis.
- }
-
- FUNCTION OCEEqualPackedRLI(prli1: PackedRLIPtr; prli2: PackedRLIPtr): BOOLEAN;
- INLINE $303C, kOCEEqualPackedRLI, $AA5C;
-
-
- {
- Check the validity of a packed RLI. This checks that the directory name length
- is within bounds, and the packed pathname (specified: if) is valid.
- }
-
- FUNCTION OCEValidPackedRLI(prli: PackedRLIPtr): BOOLEAN;
- INLINE $303C, kOCEValidPackedRLI, $AA5C;
-
-
- {
- If this packed RLI describes a Personal Directory, this call will return a pointer
- to an alias record that can be used to find the actual file. Otherwise, it returns nil.
- }
-
- FUNCTION OCEExtractAlias(prli: PackedRLIPtr): AliasPtr;
- INLINE $303C, kOCEExtractAlias, $AA5C;
-
-
- {
- This call returns a pointer to a packed RLI that represents the "Catalogs" icon, or
- the root of all directories. It is used in the CollabPack.
- }
-
- FUNCTION OCEGetDirectoryRootPackedRLI: PackedRLIPtr;
- INLINE $303C, kOCEGetRootPackedRLI, $AA5C;
-
-
-
-
-
- {*** LocalRecordID ***}
-
- TYPE
- LocalRecordID = RECORD
- cid: CreationID;
- recordName: RStringPtr;
- recordType: RStringPtr;
- END;
-
-
- LocalRecordIDPtr = ^LocalRecordID;
-
-
-
- { Create a LocalRecordID from a name, type, and CreationID }
-
- PROCEDURE OCENewLocalRecordID(recordName: RStringPtr; recordType: RStringPtr;
- cid: CreationID; VAR lRID: LocalRecordID);
- INLINE $303C, kOCENewLocalRecordID, $AA5C;
-
- {
- Copy LocalRecordID lRID1 to LocalRecordID lRID2. lRID2 must already contain
- pointers to RString structures large enough to hold copies of the corresponding
- fields from lRID1. A memFull error will be returned if that is not the case.
- So if you allocate a brand new empty destination, you must at least set up
- its length field.
- }
-
- FUNCTION OCECopyLocalRecordID(lRID1: LocalRecordID; VAR lRID2: LocalRecordID): OSErr;
- INLINE $303C, kOCECopyLocalRecordID, $AA5C;
-
-
- {
- Check the equality of two local RIDs.
- }
-
- FUNCTION OCEEqualLocalRecordID(lRID1: LocalRecordID; lRID2: LocalRecordID): BOOLEAN;
- INLINE $303C, kOCEEqualLocalRecordID, $AA5C;
-
-
-
-
- {*** ShortRecordID ***}
-
- TYPE
- ShortRecordID = RECORD
- rli: PackedRLIPtr;
- cid: CreationID;
- END;
-
- ShortRecordIDPtr = ^ShortRecordID;
-
-
-
- { Create a ShortRecordID from an RLI struct and a CreationID }
-
- PROCEDURE OCENewShortRecordID(theRLI: PackedRLIPtr; cid: CreationID;
- sRID: ShortRecordIDPtr);
- INLINE $303C, kOCENewShortRecordID, $AA5C;
-
-
- {
- Copy ShortRecordID sRID1 to ShortRecordID sRID2. sRID2 must already contain
- pointers to structures large enough to hold copies of the corresponding
- fields from sRID1. A memFull error will be returned if that is not the case.
- So if you allocate a brand new empty destination, you must at least set up
- its length fields.
- }
-
- FUNCTION OCECopyShortRecordID(sRID1: ShortRecordID; VAR sRID2: ShortRecordID): OSErr;
- INLINE $303C, kOCECopyShortRecordID, $AA5C;
-
-
- {
- Check the equality of two INTEGER RIDs.
- }
-
- FUNCTION OCEEqualShortRecordID(sRID1: ShortRecordID; sRID2: ShortRecordID): BOOLEAN;
- INLINE $303C, kOCEEqualShortRecordID, $AA5C;
-
-
-
-
- {*** RecordID ***}
-
- TYPE
- RecordID = RECORD
- rli: PackedRLIPtr; { pointer to a packed rli structure }
- local: LocalRecordID;
- END;
-
- RecordIDPtr = ^RecordID;
-
-
-
- { Create a RecordID from a packed RLI struct and a LocalRecordID.
- This doesn't allocate any new space; the RecordID points to the same
- packed RLI struct and the same name and type RStrings. }
-
- PROCEDURE OCENewRecordID(theRLI: PackedRLIPtr; lRID: LocalRecordID;
- VAR rid: RecordID);
- INLINE $303C, kOCENewRecordID, $AA5C;
-
-
- {
- Copy RecordID RID1 to RecordID RID2. RID2 must already contain
- pointers to structures large enough to hold copies of the corresponding
- fields from lRID1. A memFull error will be returned if that is not the case.
- So if you allocate a brand new empty destination, you must at least set up
- its length fields.
- }
-
- FUNCTION OCECopyRecordID(rid1: RecordID; rid2: RecordID): OSErr;
- INLINE $303C, kOCECopyRecordID, $AA5C;
-
-
- { Check the equality of two RIDs. }
-
- FUNCTION OCEEqualRecordID(rid1: RecordID; rid2: RecordID): BOOLEAN;
- INLINE $303C, kOCEEqualRecordID, $AA5C;
-
-
-
-
-
- {*** PackedRecordID ***}
-
- {
- struct PackedRecordID is a maximum-sized structure. Allocate one of
- these and it will hold any valid packed RecordID.
- }
-
- CONST
- kPackedRecordIDMaxBytes = kPathNameMaxBytes + sizeof(DNodeNum) +
- sizeof(DirDiscriminator) + sizeof(CreationID) + (3*sizeof(RString));
-
- TYPE
- PackedRecordIDHeader = RECORD
- dataLength: INTEGER; { length excludes the space for the length field }
- END;
-
- PackedRecordID = RECORD
- dataLength: INTEGER;
-
- data: PACKED ARRAY[1..kPackedRecordIDMaxBytes] OF Byte;
- END;
-
-
- {
- struct ProtoPackedRecordID is a minimum-sized structure. Use this
- for a variable-length packed RecordID.
- }
-
- ProtoPackedRecordID = RECORD
- dataLength: INTEGER;
-
- { Followed by data }
- END;
-
- PackedRecordIDPtr = ^PackedRecordID;
- ProtoPackedRecordIDPtr = ^ProtoPackedRecordID;
-
-
-
- {
- Copy PackedRecordID pRID1 to PackedRecordID pRID2. pRID2 must already contain
- pointers to structures large enough to hold copies of the corresponding
- fields from pRID1. A memFull error will be returned if that is not the case.
- pRID2Length is the number of bytes that can be put into pRID2, not counting the
- packed RecordID header.
- }
-
- FUNCTION OCECopyPackedRecordID(pRID1: PackedRecordIDPtr; pRID2: PackedRecordIDPtr;
- pRID2Length: INTEGER): OSErr;
- INLINE $303C, kOCECopyPackedRecordID, $AA5C;
-
-
- {
- Create a RecordID from a PackedRecordID.
- NOTE THAT THE UNPACKED STRUCT CONTAINS POINTERS INTO THE PACKED STRUCT - DON'T DELETE
- OR REUSE THE PACKED STRUCT UNTIL YOU ARE FINISHED WITH THE UNPACKED STRUCT AS WELL
- }
-
- PROCEDURE OCEUnpackRecordID(pRID: PackedRecordIDPtr; VAR rid: RecordID);
- INLINE $303C, kOCEUnpackRecordID, $AA5C;
-
-
- {
- Create a PackedRecordID from a RecordID. pRID must be large enough to contain
- the packed RecordID. A memFull error will be returned if that is not the case.
- packedRecordIDLength is the number of bytes that can be put into pRID, not
- counting the header.
- }
-
- FUNCTION OCEPackRecordID(rid: RecordID; pRID: PackedRecordIDPtr;
- packedRecordIDLength: INTEGER): OSErr;
- INLINE $303C, kOCEPackRecordID, $AA5C;
-
-
- {
- Compute the number of bytes of memory needed to hold a RecordID when packed. This
- length includes the length of the length field of PackedRecordID, so it
- is safe to do a NewPtr (OCEPackedRecordIDSize(...)).
- }
-
- FUNCTION OCEPackedRecordIDSize(rid: RecordID): INTEGER;
- INLINE $303C, kOCEPackedRecordIDSize, $AA5C;
-
-
- {
- Check the equality of two packed RIDs.
- }
-
- FUNCTION OCEEqualPackedRecordID(pRID1: PackedRecordIDPtr; pRID2: PackedRecordIDPtr): BOOLEAN;
- INLINE $303C, kOCEEqualPackedRecordID, $AA5C;
-
-
- { OCEValidPackedRecordID checks the validity of a packed record ID. }
-
- FUNCTION OCEValidPackedRecordID(pRID: PackedRecordIDPtr): BOOLEAN;
- INLINE $303C, kOCEValidPackedRecordID, $AA5C;
-
-
-
-
-
- {*** DSSpec ***}
-
- TYPE
- DSSpec = RECORD
- entitySpecifier: ^RecordID;
- extensionType: OSType;
- extensionSize: INTEGER;
- extensionValue: Ptr;
- END;
-
- DSSpecPtr = ^DSSpec;
-
- {
- struct PackedDSSpec is NOT a maximum-sized structure. Allocate one of
- these and it will hold any valid packed RecordID, but not necessarily any additional
- data.
- }
-
- CONST
- kPackedDSSpecMaxBytes = (sizeof (PackedRecordID) + sizeof (OSType) + sizeof (INTEGER));
-
- TYPE
- PackedDSSpecHeader = RECORD
- dataLength: INTEGER; { length excludes the space for the length field }
- END;
-
- PackedDSSpec = RECORD
- dataLength: INTEGER;
-
- data: PACKED ARRAY[1..kPackedDSSpecMaxBytes] OF Byte;
- END;
-
-
- {
- struct ProtoPackedDSSpec is a minimum-sized structure. Use this
- for a variable-length packed DSSpec.
- }
-
- ProtoPackedDSSpec = RECORD
- dataLength: INTEGER;
-
- { Followed by data }
- END;
-
- PackedDSSpecPtr = ^PackedDSSpec;
- ProtoPackedDSSpecPtr = ^ProtoPackedDSSpec;
-
-
-
- {
- Copy PackedDSSpec pdss1 to PackedDSSpec pdss2. pdss2 must already contain
- pointers to structures large enough to hold copies of the corresponding
- fields from pdss1. A memFull error will be returned if that is not the case.
- pdss2Length is the number of bytes that can be put into pdss2, not counting the
- packed DSSpec header.
- }
-
- FUNCTION OCECopyPackedDSSpec(pdss1: PackedDSSpecPtr;
- pdss2: PackedDSSpecPtr; pdss2Length: INTEGER): OSErr;
- INLINE $303C, kOCECopyPackedDSSpec, $AA5C;
-
-
- {
- Create a DSSpec from a PackedDSSpec.
- NOTE THAT THE UNPACKED STRUCT CONTAINS POINTERS INTO THE PACKED STRUCT - DON'T DELETE
- OR REUSE THE PACKED STRUCT UNTIL YOU ARE FINISHED WITH THE UNPACKED STRUCT AS WELL.
- A pointer to the extension is returned in dss->extensionValue, and the length of that
- extension is returned in dss->extensionSize. If there is no extension, dss->extensionValue will
- be set to nil. This routine will unpack the RecordID (any: if) into rid, unpack the rest
- into dss, and set dss->entitySpecifier to rid.
- }
-
- PROCEDURE OCEUnpackDSSpec(pdss: PackedDSSpecPtr; VAR dss: DSSpec;
- VAR rid: RecordID); INLINE $303C, kOCEUnpackDSSpec, $AA5C;
-
-
- {
- Create a PackedDSSpec from a DSSpec. pdss must be large enough to
- contain the packed RecordID and any extension. A memFull error will be returned if that
- is not the case. pdssLength is the number of bytes that can be put into pdss,
- not counting the header.
- }
-
- FUNCTION OCEPackDSSpec(dss: DSSpec; pdss: PackedDSSpecPtr;
- pdssLength: INTEGER): OSErr;
- INLINE $303C, kOCEPackDSSpec, $AA5C;
-
-
- {
- Compute the number of bytes of memory needed to hold a DSSpec when packed. This
- length includes the length of the length field of PackedDSSpec, so it
- is safe to do a NewPtr (OCEPackedDSSpecSize(...)).
- }
-
- FUNCTION OCEPackedDSSpecSize(dss: DSSpec): INTEGER;
- INLINE $303C, kOCEPackedDSSpecSize, $AA5C;
-
-
- { Check the equality of two DSSpecs. This compares all fields, even the
- extension (unless extensionSize == 0). The extensions are compared in a case-insensitive and
- diacrit-insensitive manner. }
-
- FUNCTION OCEEqualDSSpec(pdss1: DSSpec; pdss2: DSSpec): BOOLEAN;
- INLINE $303C, kOCEEqualDSSpec, $AA5C;
-
-
- { Check the equality of two PackedDSSpecs. This compares all fields, even the
- extension (unless extensionSize == 0). The extensions are compared in a case-insensitive and
- diacrit-insensitive manner. }
-
- FUNCTION OCEEqualPackedDSSpec(pdss1: PackedDSSpecPtr;
- pdss2: PackedDSSpecPtr): BOOLEAN;
- INLINE $303C, kOCEEqualPackedDSSpec, $AA5C;
-
-
- {
- Check the validity of a PackedDSSpec. If extensionType is
- 'entn', pdss must contain a valid entitySpecifier. For all other extensionTypes, a nil
- entitySpecifier is valid, but if non-nil, it will be checked for validity. No check
- is made on the extension.
- }
-
- FUNCTION OCEValidPackedDSSpec(pdss: PackedDSSpecPtr): BOOLEAN;
- INLINE $303C, kOCEValidPackedDSSpec, $AA5C;
-
-
- {
- Return info about a DSSpec. This routine does not check validity. If the
- DSSpec has no extension, we determine whether it represents the root of all
- directories, a single directory, a DNode, or a Record. Else it is invalid.
- If the DSSpec has an extension, we simply return the extension type.
- }
-
- FUNCTION OCEGetDSSpecInfo(spec: DSSpec): OSType;
- INLINE $303C, kOCEGetDSSpecInfo, $AA5C;
-
-
- { OCEGetExtensionType returns the extensionType imbedded in the PackedDSSpec. }
-
- FUNCTION OCEGetExtensionType(pdss: PackedDSSpecPtr): OSType;
- INLINE $303C, kOCEGetXtnType, $AA5C;
-
-
- {
- OCEStreamPackedDSSpec streams (flattens) a directory object a little at a time by
- calling the DSSpecStreamer routine that you provide.
- }
-
- TYPE
- DSSpecStreamer = ProcPtr;
- { FUNCTION DSSpecStreamer(VAR buffer: void; count: LONGINT; eof: BOOLEAN;
- userData: LONGINT): OSErr;}
-
- FUNCTION OCEStreamPackedDSSpec(dss: DSSpec; stream: DSSpecStreamer;
- userData: LONGINT; VAR actualCount: LONGINT): OSErr;
- INLINE $303C, kOCEStreamPackedDSSpec, $AA5C;
-
-
-
-
-
- {*** AttributeType ***}
-
- {
- For the record, an AttributeType is an RString with a smaller maximum size.
- I don't justtypedef it to an RString, because I want the definition of the AttributeType
- struct to contain the max length, because I need to include it in the Attribute struct
- below. But it should be possible to typecast any AttributeType to an RString and use
- all the RString utilities on it.
- }
-
- TYPE
- AttributeType = RECORD
- charSet: CharacterSet;
- dataLength: INTEGER;
-
- body: PACKED ARRAY[1..kAttributeTypeMaxBytes] OF Byte;
- { always fixed at the max size }
- END;
-
- AttributeTypePtr = ^AttributeType;
-
-
-
- {*** AttributeValue ***}
-
- AttributeTag = DescType; { same class as is used in AppleEvents }
-
- AttributeValue = RECORD
- tag: AttributeTag;
- dataLength: LONGINT;
- bytes: Ptr;
- END;
-
- AttributeValuePtr = ^AttributeValue;
-
-
- {*** Attribute ***}
-
- Attribute = RECORD
- attributeType: AttributeType;
- cid: AttributeCreationID;
- value: AttributeValue;
- END;
-
- AttributePtr = ^Attribute;
-
-
-
- FUNCTION OCEGetIndRecordType(STRINGIndex: OCERecordTypeIndex): RStringPtr;
- INLINE $303C, kOCEGetIndRecordType, $AA5C;
-
- FUNCTION OCEGetIndAttributeType(STRINGIndex: OCEAttributeTypeIndex): AttributeTypePtr;
- INLINE $303C, kOCEGetIndAttributeType, $AA5C;
-
-
- CONST
- _oceTBDispatch = $AA5E;
-
-
-
-
- {$ENDC} { UsingOCE }
-
- {$IFC NOT UsingIncludes}
- END.
- {$ENDC}
-